<?php
use yii\helpers\Html;
use yii\helpers\Url;
$this->title = '咖啡dou教育--力量与热情的化身';
?>

<style>
	.swiper-container {
		width: 1160px;
		height: 500px;
		margin:0 auto;
	}
	.swiper-slide {
		text-align: center;
		font-size: 18px;
		background: #fff;

		/* Center slide text vertically */
		display: -webkit-box;
		display: -ms-flexbox;
		display: -webkit-flex;
		display: flex;
		-webkit-box-pack: center;
		-ms-flex-pack: center;
		-webkit-justify-content: center;
		justify-content: center;
		-webkit-box-align: center;
		-ms-flex-align: center;
		-webkit-align-items: center;
		align-items: center;
	}
	.f-link ul{list-style:none;width:200px;overflow:hidden;}
	.f-link li{width:100px;float:left}
</style>
<?php
	Yii::$app->session->open();
	$user_id = Yii::$app->session->get("user_id");
	if(!empty($user_id)){
?>
	<input type="hidden" class="val" value="1">
<?php } else {?>
	<input type="hidden" class="val" value="0">
<?php } ?>
<div class="zy_banner">
  
	<div class="container">
	<center>
		<div class="banner" id="focus">
			<ul>
				<?php foreach($bannergroup as $k=>$v){?>
				<li>
					<a href="<?= Url::to([$v['banner_url']])?>" target="_blank">
                        
                        <img src="<?= 'http://files.bwphp.com/file/image/show/1160/500?path='.Html::encode($v['banner_thumb'])?>" width="1160" height="500"/>
						<div class="bannerdiv">
							<h3><?= Html::encode($v['banner_title'])?></h3>
							<div class="bannerdivli" style="font-size: 14px;"><i class="timeico"></i><?= date("Y-m-d H:i:s",Html::encode($v['banner_addtime']))?>  &nbsp;&nbsp;&nbsp;  <i class="adminico"></i></div>
							<div style="font-size: 14px;" class="bannerdivtext"><?= Html::encode($v['banner_desc'])?></div>
						</div>
					</a>
				</li>
				<?php } ?>
			</ul>
		</div>
	</center>
    </div>
</div>

<div class="zy_bg_w font12">
	<div class="container">
    	<!--直播课程-->
        <div class="zy_index_box">
        	<p class="zy_index_box_tit color99 font14"><a href="http://www.bwphp.com/index.php/course/index?2[type]=11" class="font22 s1 color33">直播课程</a><span class="s2">成为一名PHP优秀工程师，从零开始</span><a href="http://www.bwphp.com/index.php/course/index?2[type]=11" class="zy_amore2">查看更多直播课程 &gt;</a><a class="zy_amore" href="http://www.bwphp.com/course/">更多 &gt;</a></p>
            <ul class="zy_slClass">
                <?php foreach($livemessage as $k=>$v){ ?>
                    <li>
                        <div class="zhi_img"><img  style="display: inline;" alt="<?= substr(Html::encode($v['course_name']),0,30)?>" class="lazy" src="<?= 'http://files.bwphp.com/file/image/show/?path='.Html::encode($v['course_thumb']);?>" data-original="<?= 'http://files.bwphp.com/file/image/show/?path='.Html::encode($v['course_thumb']);?>"></div>
                        <div class="zhi_font color66">
                            <p class="color00 font16 p1"><?= substr(Html::encode($v['course_name']),0,30)?></p>
                            <p><?= "开始：".date("m-d H:i:s",Html::encode($v['start_time']))."<br />结束：".date("m-d H:i:s",Html::encode($v['end_time']));?></p>
                            <p>介绍：<?= substr(Html::encode($v['fit_crowd']),0,27)."...";?></p>
                            <p class="color99"><?= Html::encode($v['apply_num']);?>人正在学习</p>
                        </div>
                        <a title="<?= substr(Html::encode($v['course_name']),0,30)?>" class="getsession" href="http://www.bwphp.com/index.php/course/course-detail?course_id=<?= Html::encode($v['course_id'])?>"></a>
                    </li>
                <?php } ?>
                    
            </ul>
        </div>
        <!--视频课程-->
        <div class="zy_index_box">
        	<p class="zy_index_box_tit color99 font14"><a href="http://www.bwphp.com/index.php/course/index?2[type]=2" class="font22 s1 color33" target="_blank">视频课程</a><span class="s2">权威培训，专业老师，一流的学习平台</span><a href="http://www.bwphp.com/index.php/course/index?2[type]=2" class="zy_amore2" target="_blank">查看更多视频课程 &gt;</a><a class="zy_amore" href="http://www.bwphp.com/index.php/course/index?2[type]=2" target="_blank">更多 &gt;</a></p>
            <ul class="zy_course_list">
                <?php foreach($videomessage as $k=>$v){?>
                    <li><a class="getsession" title="<?= Html::encode($v['course_name'])?>" href="http://www.bwphp.com/index.php/course/course-detail?course_id=<?= Html::encode($v['course_id'])?>" target="_blank">
                        <p><img alt="<?= Html::encode($v['course_name'])?>" src="<?= 'http://files.bwphp.com/file/image/show/275/175?path='.Html::encode($v['course_thumb'])?>" data-original="<?= 'http://files.bwphp.com/file/image/show/275/175?path='.Html::encode($v['course_thumb'])?>" class="lazy" style="display: inline;"></p>
                        <div class="">
                            <p class="font14"><?= Html::encode($v['course_name'])?></p>
                            <p class="color99"><?= Html::encode($v['apply_num'])?>人正在学习</p>
                        </div>
                    </a></li>
				<?php } ?>
            </ul>
        </div>

    </div>
</div>
<div class="zy_bg_w font12 marginB50" style="padding-bottom:80px;">
	<div class="container">
    	<!--师资力量-->
        <div class="zy_index_box">
        	<p class="zy_index_box_tit color99 font14"><a href="http://www.bwphp.com/index.php/teacher/index" class="s1 font22 color33" target="_blank">师资力量</a><span class="s2">服务一线名师，聚合优质资源助您搭建信息化完整教学体系</span><a href="http://www.bwphp.com/index.php/teacher/index" target="_blank">查看更多老师 &gt;</a></p>
            <ul class="zy_ming_div">
                <?php foreach($teacherrmd as $k=>$v){ ?>
                    <li><a title="Sundy" href="http://www.bwphp.com/index.php/teacher/teacherinfo?teacher_id=<?= Html::encode($v['teacher_id'])?>" target="_blank">
                        <div class="marginB10 t3out"><img style="display: inline;" alt="<?= Html::encode($v['position_name'])?>" height="200px" width="250px" class="lazy" src="http://files.bwphp.com/file/image/show/200/200?path=<?= Html::encode($v['teacher_thumb'])?>" data-original="http://files.bwphp.com/<?= Html::encode($v['teacher_thumb'])?>"></div>
                        <p class="color33 font18 textC marginB10"><?= Html::encode($v['teacher_name'])?></p>
                        <p class="color99 pb"><?= Html::encode($v['teacher_desc'])?></p>
                        </a>
                    </li>
                <?php } ?>
            </ul>
        </div>
    </div>
</div>

   
  <div class="v5-footer" style=" background: #2D3237 none repeat scroll 0% 0%">
    <div class="container">
        <div class="v5-footer-links cf visible-md visible-lg">
          <dl class="f-link" style="width: 270px;">
            <dt>友情链接</dt>
            <dd>
              <ul>
                <?php foreach($friend_link as $k=>$v){?>
	              <li>

	                  <a target="_blank" href="<?= Html::encode($v['link_url']);?>" title="null"><?= Html::encode($v['link_name']);?></a>
	                   <span></span>
	              </li>
				<?php } ?>
          
              </ul>
            </dd>
          </dl>

	        <dl class="f-link" style="width: 270px;">
		        <dt>关于我们</dt>
		        <dd>
			        <ul>
				        <?php foreach($about as $k=>$v){?>
					        <li>

						        <a target="_blank" href="<?= Url::to(['site/single'])?>?url=<?= Html::encode($v['page_url']);?>" title="null"><?= Html::encode($v['page_title']);?></a>
						        <span></span>
					        </li>
				        <?php } ?>

			        </ul>
		        </dd>
	        </dl>

          <dl class="follow">
            <dd>
              <ul>
                <li><a href="http://weibo.com/microoh"><p><img src="/static/images/weibo_code.png"></p><p>新浪<br>新浪微博</p></a></li>
                <li style="margin-left: 50px;"><p><img src="http://files.bwphp.com/file/image/show/115/115?path=<?= Html::encode($wechat_code)?>"></p><p style="color: #b1cfd9">腾讯<br>官方微信</p></li>
              </ul>
            </dd>
          </dl>
          <dl class="f-link" style="width: 270px;">
            <dt>网站导航</dt>
            <dd>
              <ul>
	              <?php foreach($web_nav as $k=>$v){ ?>
		              <?php if($v['nav_status'] == 1){ ?>
                <li><a href="<?= Url::to([Html::encode($v['nav_url'])])?>"><?= Html::encode($v['nav_name'])?></a></li>
	              <?php }} ?>
              </ul>
            </dd>
          </dl>
        </div>


    </div>
</div>
<script>
	$(function(){
		//banner切换
		var sWidth = $("#focus").width();
		var len = $("#focus ul li").length;
		var index = 0;
		var picTimer;
		var btn = "<div class='btnBg'></div><div class='lunbo'>";
		for(var i=0; i < len; i++) {
			btn += "<span></span>";
			}
		btn += "</div><div class='preNext pre'></div><div class='preNext next'></div>";
		$("#focus").append(btn);
		$("#focus .lunbo span").css("opacity",0.4).mouseover(function() {
			index = $("#focus .lunbo span").index(this);
			showPics(index);
		}).eq(0).trigger("mouseover");
		$("#focus ul").css("width",sWidth * (len));
		$("#focus").hover(function() {
			clearInterval(picTimer);
		},function() {
			picTimer = setInterval(function() {
				showPics(index);
				index++;
				if(index == len) {index = 0;}
			},3000);
		}).trigger("mouseleave");
		function showPics(index) {
			var nowLeft = -index*sWidth;
			$("#focus ul").stop(true,false).animate({"left":nowLeft},300);
			$("#focus .lunbo span").stop(true,false).animate({"opacity":"0.4"},300).eq(index).stop(true,false).animate({"opacity":"1"},300);
		}

//        热门板块循环li
		$(".hotul li:even").css({"background":"#f8f8f8","height":"33px","line-height":"33px"});
		var $hotul = $(".hotul li");
		$hotul.eq(0).addClass("cli1");
		$hotul.eq(1).addClass("cli2");
		$hotul.eq(2).addClass("cli3");
	});

	/*判断是否登陆*/
	$(".getsession").click(function(){
		var id = $(".val").val();
		if(id == "1")
		{
			return true;
		}
		else
		{
			login_popup();
			return false;
		}
	})

</script>